<template>
  <div>
    <base-echart v-bind="options"></base-echart>
  </div>
</template>

<script setup lang="ts">
import BaseEchart from '@/base-ui/echart/src/base-echart.vue'
import { computed, defineProps } from 'vue'
import { IDataType } from '../types'

const props = defineProps<{
  roseData: IDataType[]
}>()
const options = computed(() => ({
  width: '100%',
  height: '360px',
  option: {
    legend: {
      top: 'bottom'
    },
    toolbox: {
      show: true,
      feature: {
        mark: { show: true },
        dataView: { show: true, readOnly: false },
        restore: { show: true },
        saveAsImage: { show: true }
      }
    },
    series: [
      {
        name: '类别数据',
        type: 'pie',
        radius: [10, 50],
        center: ['50%', '50%'],
        roseType: 'area',
        itemStyle: {
          borderRadius: 8
        },
        data: props.roseData
      }
    ]
  }
}))
</script>
<style scoped></style>
